package com.gw.controller;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author keluoyisi
 * @program: security-thymeleaf
 * @description:
 * @date 2023-01-03 23:44:37
 */
@Controller
public class PageController {
    @RequestMapping("main")
    public String main(){
        return "main";
    }

    @GetMapping("delete")
    @PreAuthorize(value = "hasAuthority('user:delete')")
    public String delete(){

        return "用户删除的操作";
    }

    @GetMapping("insert")
    @PreAuthorize(value = "hasAuthority('user:insert')")
    public String insert(){

        return "用户添加的操作";
    }
    @GetMapping("update")
    @PreAuthorize(value = "hasAuthority('user:update')")
    public String update(){

        return "用户修改的操作";
    }
    @GetMapping("query")
    @PreAuthorize(value = "hasAuthority('user:query')")
    public String query(){

        return "用户查询的操作";
    }
    @GetMapping("export")
    @PreAuthorize(value = "hasAuthority('user:export')")
    public String export(){

        return "用户导出的操作";
    }
}
